<?php
defined('IN_TS') or die('Access Denied.');


$title = $TS_SITE['site_subtitle'];
$arrUser = aac('user')->find('user_info',array('userid'=>$_SESSION['tsuser']['userid']));

//查看有无最新公告
$arrNotice = aac('article')->find('article','isnotice=1 and addtime>'.strtotime('-3 day'),'','addtime desc');
if($arrNotice){
    $arrNotice['content'] = tsDecode($arrNotice['content']);
    $arrRead = explode(',',$_COOKIE['read_notice']);
    if($arrNotice['groupid']== 0 ){
        if($arrUser['groupids']&&!in_array($arrNotice['articleid'],$arrRead)){
            $show_notice = $arrNotice;
            $show_notice['noticeid'] = $arrNotice['articleid'];
        }
    }else{
        $arrGroupids = explode(',',$arrUser['groupids']);
        if (in_array($arrNotice['groupid'],$arrGroupids)&&!in_array($arrNotice['articleid'],$arrRead)){
            $show_notice = $arrNotice;
            $show_notice['noticeid'] = $arrNotice['articleid'];
        }
    }

}

//提醒是否愿意担任教练
if($arrUser['iscoach'] == 0){
    $count_duty = aac('duty')->findCount('duty',array('userid'=>$_SESSION['tsuser']['userid'],'status'=>1,'cateid'=>1));

}


include template("index");